package com.jxjk.reportwork.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.jxjk.reportwork.exceldo.RealReportDetailInExcelDO;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;

import java.util.List;

/**
 * 2024.9.13: 解析实际报工明细excel表格
 */
@Data
@Slf4j
public class RealReportPlanListener extends AnalysisEventListener<RealReportDetailInExcelDO> {
    private List<RealReportDetailInExcelDO> realReportDetailInExcelDOList = Lists.newArrayList();

    @Override
    public void invoke(RealReportDetailInExcelDO realReportDetailInExcelDO, AnalysisContext analysisContext) {
//        log.info("实际报工明细:{}", realReportDetail);
        this.realReportDetailInExcelDOList.add(realReportDetailInExcelDO);
    }


    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        log.info("[实际报工明细]数据读取完成");
    }
}
